﻿using System.Web.Mvc;
using System.Web.Routing;

namespace viBook.Filters
{
    public class JsonAuthentication : ExtendedAuthenticationBase
    {
        protected override void HandleUnauthorizedRequest(AuthorizationContext filterContext)
        {
            if (!IsLoggedIn || !IsActivated || !IsAllowToUseResource)
                filterContext.Result = new HttpStatusCodeResult(999);
        }
    }
}